package com.sixseven.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author Belly
 * @version 1.1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("member")
public class Member {
    @TableId(type = IdType.AUTO)
    private Integer id;
    @NotEmpty(message = "用户名不能为空")
    @Pattern(regexp = "^\\w{4,10}$", message = "用户名为4-10个字符")
    private String username;
    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = "^\\w{6,10}$", message = "密码为6-10个字符")
    private String password;
    @NotEmpty(message = "邮箱地址不能为空")
    @Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", message = "email格式不正确")
    private String email;
    private Integer status;

}
